﻿using NUnit.Framework;
using AdventureWorks.DataAccess.repository;
using AdventureWorks.Domain;
using System.Collections.Generic;
using NHibernate.Linq;
using System.Linq;

namespace AdventureWorks.DataAccess.Test.repository
{
    [TestFixture]
    public class PersonTest : RepositoryTestBase<PersonRepository>
    {
        [SetUp]
        public void Setup()
        {
            var p = new Person { Title = "Mr.", Suffix = "Jr.", PersonType = "EM", MiddleName = "E", LastName = "Karwchan", FirstName = "Ghassan" };
            p.Emails = new List<string>() { "email1", "email2" };
            session.Save(p);
            p = null;
        }

        [Test]
        public void FirstTest()
        {
            var ps = session.Query<Person>();
            var d = ps.Count();
            Assert.AreEqual(1, d);
        }

    }
}
